<template>
    <div>
        <van-search v-model="value" shape="round"  placeholder="请输入搜索关键词" />
        <van-cell icon="shop-o">
            <!-- 使用 title 插槽来自定义标题 -->
            <template #title>
                <span class="custom-title">华为</span>
                <van-tag type="primary">店铺</van-tag>
            </template>
        </van-cell>
        <div v-for="item in qsearch">
            <van-cell :title="item.goods_name">
                <!-- 使用 right-icon 插槽来自定义右侧图标 -->
                <template #right-icon>
                    <van-icon name="search" class="search-icon" />
                </template>
            </van-cell>

        </div>






    </div>
</template>

<script setup>
import { ref, watch } from 'vue';
import { qsearchApi } from '@/api/api';
let qsearch = ref([])
let value = ref('')
watch(value, (val) => {
    qsearchApi(val).then(res => {
        console.log('搜索', res)
        qsearch.value = res.data.message

    })

})


</script>

<style lang="scss" scoped></style>